#
#  Projectiles.py
#  TwoHand
#
#  Created by Pete Lord on 17/12/2008.
#  Copyright (c) 2008 __MyCompanyName__. All rights reserved.
#

import math, pygame

class Projectile():
    def __init__(self, screen, origin, rotation, player):
        # projectiles do not spawn other projectiles at the moment, so don't use an entities reference.
        self.screen = screen
        
        self.origin = origin
        print self.origin
        
        self.x = self.origin[0]
        self.y = self.origin[1] # hardpoints, barrel end etc.
        self.speed = 5 # arbitrary. redefined in each subclass.
        
        self.rotation = rotation # which way we be headed captain?
        
        self.player = player # boolean to determine wether or not this projectile belongs to the player.
        
    def poll(self):
        self.y -= math.cos(self.rotation) * self.speed
        self.x += math.sin(self.rotation) * self.speed
        
    def draw(self):
        pygame.draw.circle(self.screen, (255, 255, 255), (self.x, self.y), 3) # meh, it'll do for now.